HAL HASH constants migration

This section provides information about the HAL HASH constants migration.

HAL HASH error codes constants

HAL1

HAL2

#define HAL_HASH_ERROR_NONE
#define HAL_HASH_ERROR_DMA

#define HAL_HASH_ERROR_BUSY
#define HAL_HASH_ERROR_INVALID_CALLBACK
#define HAL_HASH_ERROR_IT
#define HAL_HASH_ERROR_TIMEOUT
#define HAL_HASH_ERROR_NONE
#define HAL_HASH_ERROR_DMA


Removed; these kinds of logical errors are reported by the direct function return.

Related concept: Revised and optimized HAL error management


HAL HASH version constants

HAL1

HAL2

#define HAL_HASH_VERSION

Removed; this constant is no longer available, the hash driver version is managed according to the product series.


HAL HASH algorithm modes constants

HAL1

HAL2

#define HASH_ALGOMODE_HASH
#define HASH_ALGOMODE_HMAC

Removed; In HAL2, these constants are managed internally by the HAL APIs according to whether the process is HASH or HMAC.


HAL HASH algorithm selection options constants

HAL1

HAL2



#define HASH_ALGOSELECTION_MD5
#define HASH_ALGOSELECTION_SHA1
#define HASH_ALGOSELECTION_SHA224
#define HASH_ALGOSELECTION_SHA256
#define HASH_ALGOSELECTION_SHA384
#define HASH_ALGOSELECTION_SHA512_224
#define HASH_ALGOSELECTION_SHA512_256
#define HASH_ALGOSELECTION_SHA512
typedef enum
{
  HAL_HASH_ALGO_MD5,
  HAL_HASH_ALGO_SHA1,
  HAL_HASH_ALGO_SHA224,
  HAL_HASH_ALGO_SHA256,
  HAL_HASH_ALGO_SHA384,
  HAL_HASH_ALGO_SHA512224,
  HAL_HASH_ALGO_SHA512256,
  HAL_HASH_ALGO_SHA512,
  HAL_HASH_ALGO_SHA3224,
  HAL_HASH_ALGO_SHA3256,
  HAL_HASH_ALGO_SHA3384,
  HAL_HASH_ALGO_SHA3512,
  HAL_HASH_ALGO_SHAKE128,
  HAL_HASH_ALGO_SHAKE256,
} hal_hash_algo_t;

Note

Support for these algorithms is device-dependent and may not be available on all products

Related concepts:


HAL HASH data swap modes constants

HAL1

HAL2



#define HASH_NO_SWAP
#define HASH_HALFWORD_SWAP
#define HASH_BYTE_SWAP
#define HASH_BIT_SWAP
typedef enum
 {
  HAL_HASH_DATA_SWAP_NO,
  HAL_HASH_DATA_SWAP_HALFWORD,
  HAL_HASH_DATA_SWAP_BYTE,
  HAL_HASH_DATA_SWAP_BIT,
 } hal_hash_data_swapping_t;

Related concepts :


HAL HASH data type sizes constants

HAL1

HAL2



#define HASH_DATATYPE_32B
#define HASH_DATATYPE_16B
#define HASH_DATATYPE_8B
#define HASH_DATATYPE_1B
typedef enum
{
 HAL_HASH_DATA_SWAP_NO,
 HAL_HASH_DATA_SWAP_HALFWORD,
 HAL_HASH_DATA_SWAP_BYTE,
 HAL_HASH_DATA_SWAP_BIT,
} hal_hash_data_swapping_t;

Related concepts:


HAL HASH status flags constants

HAL1

HAL2

#define HASH_FLAG_DINIS
#define HASH_FLAG_DCIS
#define HASH_FLAG_DMAS
#define HASH_FLAG_BUSY
#define HASH_FLAG_DINNE
#define HAL_HASH_FLAG_DINI
#define HAL_HASH_FLAG_DCI
#define HAL_HASH_FLAG_DMA
#define HAL_HASH_FLAG_BUSY
#define HAL_HASH_FLAG_DINNE

HAL HASH HMAC key types constants

HAL1

HAL2

#define HASH_HMAC_KEYTYPE_LONGKEY
#define HASH_HMAC_KEYTYPE_SHORTKEY

Removed; in HAL2 all HMAC key types are used within HAL HMAC process APIs and do not affect user level operation.


HAL HASH interrupt identifiers constants

HAL1

HAL2

#define HASH_IT_DINI
#define HASH_IT_DCI
#define HAL_HASH_IT_DIN
#define HAL_HASH_IT_DC

HAL HASH key length types constants

HAL1

HAL2

#define HASH_LONGKEY
#define HASH_SHORTKEY

Removed; in HAL2 all HASH key types are used within HAL HASH process APIs and do not affect user level operation.